package com.qidian.by.upload.controller;

import com.qidian.by.upload.service.UploadFileService;
import com.qidian.by.util.pojo.EsResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Author: CoolPro
 * @Description:
 * @Time: 2024-05-08 09:24
 **/
@RestController
public class UploadController {
    @Autowired
    private UploadFileService uploadFileService;

    @RequestMapping("/image")
    public EsResult uploadImage(@RequestParam("file") MultipartFile file) {
        return uploadFileService.uploadImage(file);
    }
}
